import React from 'react';
import $ from 'jquery';
import './jquery.form';
import sys_dict from "sys_dict";
const filter = {};

filter.convert = function (type,value) {
    if(!value){
        return "";
    }
    var _text="";
    switch (type){
        case "orglevel" :
            _text=sys_dict.orglevel[value];
            break;
        case "org_state" :
            _text=sys_dict.org_state[value];
            break;
        case "pgmtype" :
            sys_dict.pgmtype.forEach(function(e){
                if(e.value==value){
                    _text=e.text;
                }
            });
            break;

        default:
            _text=""
    }
    return _text;
};
//用户管理-用户状态过滤器
filter.userStatus = function (value) {
    var _text="";
    switch (value){
        case "N" :
            _text="正常";
            break;
        case "F" :
            _text="停用";
            break;
        case "D" :
            _text="注销";
            break;

        default:
            _text=""
    }
    return _text;
};
filter.userStatusSwitch = function (value) {
    var _text="";
    switch (value){
        case "N" :
            _text="停用";
            break;
        case "F" :
            _text="启用";
            break;
        case "D" :
            _text="启用";
            break;

        default:
            _text=""
    }
    return _text;
};

export default filter ;

